﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>场馆会员卡</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet" />
    <style>
        .veads1_i1 {
            display: block;
            float: left;
            margin-top: 2%;
            width: 2.5%;
        }
        .veads1_s1 {
            display: block;
            text-align: center;
            font-size: 1.8rem;
        }
        .main{
            padding: 3% 5%;
            width: 100%;
            overflow: hidden;
        }
        .main_d1{
            border-radius: 10px;
            width: 100%;
            overflow: hidden;
            border:none;
            margin-bottom: 3%;
        }
        .am-panel-hd{
            width: 100%;
            background: #e8c285;
            padding-top: 4%;
        }
        .main_panimg01{
            width: 16%;
            background: inherit;
        }
        .am-panel-bd{
            background: #fff;

        }
        .main_pan01,.main_pan02{
            display: block;
            width: 80%;
            text-align: right;
            background: inherit;
            float: right;
        }
        .main_pan01{
            font-size: 1.7rem;
            color: #fff;
        }
        .main_pan02{
            margin-top: -8%;
            font-size: 1.2rem;
            color: #ad8347;
        }
        .main_panimg02{
            width: 100%;
            background:#e8c285 ;
        }
        .main_pand1{
            background: inherit;
        }
        .main_panspan2{
            background: inherit;
            color: #98989a;
            font-size: 1.2rem;
        }
        .main_panimg03{
            background: inherit;
            width:5%;
            display: block;
            float: left;
            margin-top: 2.5%;
            margin-right: 2%;
        }
        .main_panspan1{
            background: inherit;
            color: #ad8347;
            margin-top: -14%;
            float: right;
            font-size: 2rem;
        }
    </style>
</head>
<body>
    <div class="page" id="page" v-cloak>
        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">会员卡</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <div class="main">
            <div class="am-panel main_d1" v-for="(list,index) in discount">
                <div class="am-panel-hd">
                    <img src="images/vipcard_logo.png" alt="" class="main_panimg01">
                    <span class="main_pan01">{{list.discount.Name}}</span>
                    <span class="main_pan02">普通会员</span>
                </div>
                <img src="images/vipcard01.png" alt="" class="main_panimg02" style="margin-top: -9%;">
                <div class="am-panel-bd" style="margin-top: -7%;">
                    <div class="main_pand1">
                        <img src="images/vipcard02.png" alt="" class="main_panimg03">
                        <span class="main_panspan2">本月剩余使用次数<span style="background: inherit;color: #fea729;">{{list.discount.number-list.count}}</span>次</span>
                    </div>
                    <div class="main_pand1">
                        <img src="images/vipcard03.png" alt="" class="main_panimg03">
                        <span class="main_panspan2">截止 {{list.state}}使用</span>
                    </div>
                    <span class="main_panspan1">可享{{list.discount.Type==1?list.discountValue + "元":list.discountValue +"%"}}优惠</span>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="https://use.fontawesome.com/ca6b609d64.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="https://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.js"></script>
</html>
<script>
    var page = new Vue({
        el: '#page',
        data: {
            discount: [],//优惠券/卡数组
        },
        methods: {
            getInfo: function () {
                var that = this;
                $.ajax({
                    type: 'POST',
                    url: apiUrl + '/Api/Mine/GetAllCard',
                    success: function (data) {
                        console.log(data);
                        if (data.errcode == 0) {
                            that.discount = data.data;
                        } else if (data.errcode == -1) {
                            alert(data.errmsg);
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            }
        }
    });

    $(function () {
        page.getInfo();
    })

</script>
